 

import java.util.ArrayList;

/**
 * Superclass!
 * Trade class
 * @author Stefan
 */
public class Trade
{
    //Attributes

    private ArrayList<SalesLineItem> trades;
    private String id;
    private String employeeID;
    private String customerID;

    public Trade(String id, String employeeID, String customerID)
    {
        trades = new ArrayList<SalesLineItem>();
        this.id = id;
        this.employeeID = employeeID;
        this.customerID = customerID;
    }

    public boolean addSalesLineItem(SalesLineItem sli)
    {
        trades.add(sli);
        return true;
    }

    public boolean deleteSaleslineItem(SalesLineItem sli)
    {
        trades.remove(sli);
        return true;
    }

    public SalesLineItem findSalesLineItem(int listNumber)
    {
        SalesLineItem sli = null;
        sli.equals(trades.get(listNumber));
        return sli;
    }

    public double totalPrice()
    {
        double total = 0;
        for (SalesLineItem sli : trades)
        {
            total = total + sli.subTotalPrice();
        }
        return total;
    }

    //Getters and setters
    public int getSize()
    {
        return trades.size();
    }
    
    public String getId()
    {
        return id;
    }

    public void setId(String id)
    {
        this.id = id;
    }

    public ArrayList<SalesLineItem> getSaleLines()
    {
        return trades;
    }

    public String getCustomerID()
    {
        return customerID;
    }

    public void setCustomerID(String customerID)
    {
        this.customerID = customerID;
    }

    public String getEmployeeID()
    {
        return employeeID;
    }

    public void setEmployeeID(String employeeID)
    {
        this.employeeID = employeeID;
    }
}
